package com.peixunp.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.peixunp.service.InformationService;

import finaler.util.Page;
import finaler.util.PageList;

@Controller
@RequestMapping("information")
public class InformationController {

	@Autowired
	private InformationService informationService;

	@RequestMapping( value="/index.html" )
	public String good(HttpServletRequest request) throws Exception {
		Page page = new Page(request);
		page.setRange(50);
		page.putParameter("infoKey", request.getParameter("infoKey") );
		PageList infoList = informationService.getAllInfoList(page);
		request.setAttribute("infoList", infoList);
		return "/information/list";
	}

}
